package com.slfx.tinyid.client.controller;

import com.xiaoju.uemc.tinyid.client.utils.TinyId;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zengqingfa
 * @className IdController
 * @description
 * @create 2023/1/7 22:28
 */
@RestController
@RequestMapping("/client/id/")
public class IdController {


    @GetMapping("/nextId")
    public Long nextId(String bizType) {
        return TinyId.nextId(bizType);
    }

    @GetMapping("/batchNextId")
    public List<Long> batchNextId(String bizType, Integer batchSize) {
        return TinyId.nextId(bizType, batchSize);
    }

}